// pages/prize/prize.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    img: '',
    wechat: "../../image/wechat.png",
    quan: "../../image/quan.png",
    inputValue: "",
    maskHidden: false,
    name: "",
    touxiang: "",
  },
  
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getCode()

  },
  /**
   * 获取邀请码
   */
   getCode: function (){
     var that = this
     var openid = app.globalData.userInfo.open_id
     wx.request({
       url: app.globalData.apiUrl + '/api/user/myCode',
       data: { openid: app.globalData.openid },
       method: 'GET',
       dataType: 'json',
       success: function (res) {
        
         that.setData({ img: res.data, nickname: app.globalData.userInfo.nickname })

       },
       fail: function (res) { },
       complete: function (res) { },
     })
   },
 

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },
  /**
   * 分享
   */
  onShareAppMessage: function (res) {
    return {
      title: "这个是我分享出来的东西",
      success: function (res) {
        console.log(res, "转发成功")
      },
      fail: function (res) {
        console.log(res, "转发失败")
      }
    }
  },

})